import { ADD_PERSON } from '../constant';

const initPerState = [{ id: '001', name: '老何', age: 28 }]
const reducer = (perState = initPerState, action) => {
  const { type, data } = action
  switch (type) {
    case ADD_PERSON:
      return [ data, ...perState ]
    default:
      return perState
  }
}

export default reducer;